CREATE TABLE [dbo].[wap_log_errores_temp]
(
[nu_operacion] [dbo].[_autonumerico] NOT NULL IDENTITY(1, 1),
[nm_programa] [dbo].[_codigo_largo] NOT NULL,
[cd_operador] [dbo].[_nombre] NOT NULL,
[fe_operacion] [dbo].[_fechahora] NOT NULL,
[de_operacion] [dbo].[_descripcion] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[wap_log_errores_temp] ADD CONSTRAINT [PK_wap_log_errores_temp] PRIMARY KEY CLUSTERED  ([nu_operacion]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_wap_log_errores_temp_1] ON [dbo].[wap_log_errores_temp] ([cd_operador]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_wap_log_errores_temp] ON [dbo].[wap_log_errores_temp] ([nm_programa]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[wap_log_errores_temp] ADD CONSTRAINT [FK_wap_log_errores_temp_wad_operadores] FOREIGN KEY ([cd_operador]) REFERENCES [dbo].[wad_operadores] ([cd_operador]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[wap_log_errores_temp] ADD CONSTRAINT [FK_wap_log_errores_temp_wad_programas] FOREIGN KEY ([nm_programa]) REFERENCES [dbo].[wad_programas] ([nm_programa]) ON DELETE CASCADE
GO
EXEC sp_bindefault N'[dbo].[date]', N'[dbo].[wap_log_errores_temp].[fe_operacion]'
GO
